<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="pt" xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:sec="http://www.springframework.org/security/facelets/tags"
	xmlns:p="http://primefaces.org/ui">
<ui:composition template="/templates/homeGerente.xhtml">
	<ui:define name="corpo">
		<h:form id="formCad">
			<div align="center">
				<h:panelGrid columns="1">
					<div class="user" align="center">
						<p:panel toggleable="false" header="Dados do Estabelecimento">
							<p:panelGrid columns="2">
								<p:panelGrid columns="2">
									<h:outputLabel value="Nome:" />
									<p:inputText value="#{estabelecimentoMB.entity.nome}"
										requiredMessage="Campo nome obrigatorio" required="true"
										validatorMessage="Campo Nome: Tamanho Minimo de 3 e Máximo de 50">
										<f:validateLength minimum="3" maximum="50" />
									</p:inputText>
								</p:panelGrid>
								<p:panelGrid columns="2">
									<h:outputLabel value="CNPJ:" />
									<p:inputMask value="#{estabelecimentoMB.entity.cnpj}"
										requiredMessage="Campo CNPJ obrigatorio" required="true"
										mask="999.999.999-99">
									</p:inputMask>
								</p:panelGrid>
								<p:panelGrid columns="2">
									<h:outputLabel value="Possui Entrega:" />
									<p:selectOneRadio
										value="#{estabelecimentoMB.entity.sePossuiEntrega}">
										<f:selectItem itemLabel="Sim" itemValue="S" />
										<f:selectItem itemLabel="Não" itemValue="N" />
									</p:selectOneRadio>
								</p:panelGrid>
								<p:panelGrid columns="2">
									<h:outputLabel value="Email:" />
									<p:inputText value="#{estabelecimentoMB.entity.email}"
										required="true" requiredMessage="Email:Campo obrigatório">

									</p:inputText>
								</p:panelGrid>
							</p:panelGrid>
						</p:panel>
						<p:panel toggleable="false" header="Dados de Acesso"
							styleClass="semBorda">
							<div align="center">
								<p:panelGrid columns="2">
									<p:panelGrid columns="2">
										<h:outputLabel value="Login :" />
										<p:inputText value="#{estabelecimentoMB.usuario.login}">
										</p:inputText>
									</p:panelGrid>
									<p:panelGrid columns="2">
										<h:outputLabel value="Senha :" />
										<p:keyboard value="#{estabelecimentoMB.usuario.senha}"
											keypadOnly="true" password="true" closeLabel="Fechar"
											clearLabel="Limpar" backspaceLabel="Deletar" />
									</p:panelGrid>
								</p:panelGrid>
							</div>
						</p:panel>
					</div>
				</h:panelGrid>
				<p:commandButton value="Salvar"
					action="#{estabelecimentoMB.saveOrUpdate}" ajax="false" />
			</div>
		</h:form>
	</ui:define>
</ui:composition>
</html>